home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / BREAK < prev    next >
Text File  |  1994-04-25  |  422b  |  26 lines

  1. BREAK:
  2.  
  3.     The break statement functions similar to the C break. The
  4.     break statement provides an early exit from the enclosing for,
  5.     or while loop. For example:
  6.  
  7.     > while ( i < 100 ) {
  8.     >   if(i == 10) { break; }
  9.     >   i++;
  10.     > }
  11.     > i
  12.      i =
  13.               10
  14.     //
  15.     // OR
  16.     //
  17.  
  18.     > i=0;j=0;
  19.     > while (i < 5) { while (j < 5) { if (j == 3) { break } j++; } i++; } i j 
  20.      i =
  21.             5
  22.      j =
  23.             3
  24.  
  25. See Also: CONTINUE, FOR, WHILE
  26.